package com.example.mardan_demo1.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MvcConfig implements WebMvcConfigurer {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // 自定义上传目录的资源处理
        registry.addResourceHandler("/uploads/**")
//                .addResourceLocations("file:/var/uploads/"); // Linux 示例
         .addResourceLocations("file:/D:/files/"); // Windows 示例
    }
}